/**
 * 
 */
package archsw0904.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;



/**
 * @author ASGroup0904
 */

@Entity
public class Cart implements Serializable {

	private static final long serialVersionUID = 8262391492067655227L;
	
	@Id @GeneratedValue
	private Integer cartId;
	private Date date = null ;
	@OneToOne
	private ProfileClient client;
	@ManyToMany(targetEntity=OrderedCopies.class)
	private Map<Book,OrderedCopies> CartLines = new HashMap<Book,OrderedCopies>();
	private BigDecimal total = new BigDecimal(0) ;	
	
	public Integer getCartId() {
		return cartId;
	}
	public void setCartId(Integer cartId) {
		this.cartId = cartId;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public ProfileClient getClient() {
		return client;
	}
	public void setClient(ProfileClient client) {
		this.client = client;
	}
	public Map<Book, OrderedCopies> getCartLines() {
		return CartLines;
	}
	public void setCartLines(Map<Book, OrderedCopies> cartLines) {
		CartLines = cartLines;
	}
	public void setTotal(BigDecimal total) {
		this.total = total;
	}
	public BigDecimal getTotal() {
		return total;
	}
	
}
